package com.ruoyi.system.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.GxComponentCategoryMapper;
import com.ruoyi.system.domain.GxComponentCategory;
import com.ruoyi.system.service.IGxComponentCategoryService;

/**
 * 组件分类Service业务层处理
 * 
 * @author hy
 * @date 2022-11-24
 */
@Service
public class GxComponentCategoryServiceImpl implements IGxComponentCategoryService 
{
    @Autowired
    private GxComponentCategoryMapper gxComponentCategoryMapper;

    /**
     * 查询组件分类
     * 
     * @param id 组件分类主键
     * @return 组件分类
     */
    @Override
    public GxComponentCategory selectGxComponentCategoryById(Long id)
    {
        return gxComponentCategoryMapper.selectGxComponentCategoryById(id);
    }

    /**
     * 查询组件分类列表
     * 
     * @param gxComponentCategory 组件分类
     * @return 组件分类
     */
    @Override
    public List<GxComponentCategory> selectGxComponentCategoryList(GxComponentCategory gxComponentCategory)
    {
        return gxComponentCategoryMapper.selectGxComponentCategoryList(gxComponentCategory);
    }

    /**
     * 查询所有组件分类列表
     *
     * @param gxComponentCategory 组件分类
     * @return 组件分类
     */
    @Override
    public List<GxComponentCategory> selectGxComponentCategoryAll()
    {
        return gxComponentCategoryMapper.selectGxComponentCategoryAll();
    }

    /**
     * 新增组件分类
     * 
     * @param gxComponentCategory 组件分类
     * @return 结果
     */
    @Override
    public int insertGxComponentCategory(GxComponentCategory gxComponentCategory)
    {
        gxComponentCategory.setCreateTime(DateUtils.getNowDate());
        return gxComponentCategoryMapper.insertGxComponentCategory(gxComponentCategory);
    }

    /**
     * 修改组件分类
     * 
     * @param gxComponentCategory 组件分类
     * @return 结果
     */
    @Override
    public int updateGxComponentCategory(GxComponentCategory gxComponentCategory)
    {
        gxComponentCategory.setUpdateTime(DateUtils.getNowDate());
        return gxComponentCategoryMapper.updateGxComponentCategory(gxComponentCategory);
    }

    /**
     * 批量删除组件分类
     * 
     * @param ids 需要删除的组件分类主键
     * @return 结果
     */
    @Override
    public int deleteGxComponentCategoryByIds(Long[] ids)
    {
        return gxComponentCategoryMapper.deleteGxComponentCategoryByIds(ids);
    }

    /**
     * 删除组件分类信息
     * 
     * @param id 组件分类主键
     * @return 结果
     */
    @Override
    public int deleteGxComponentCategoryById(Long id)
    {
        return gxComponentCategoryMapper.deleteGxComponentCategoryById(id);
    }
}
